package club.xyes.zkh.ecommerce.commons.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * Create by 郭文梁 2019/4/18 0018 13:27
 * UserCoupon
 * 用户拥有优惠券 实体类
 *
 * @author 郭文梁
 * @data 2019/4/18 0018
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(name = "t_user_coupon")
public class UserCoupon extends BaseEntity {
    /**
     * 状态：可用
     */
    public static final int STATUS_ENABLE = 0x01;
    /**
     * 状态：已使用
     */
    public static final int STATUS_USED = 0x02;
    /**
     * 状态：禁用
     */
    public static final int STATUS_DISABLE = 0x03;
    /**
     * 用户ID
     */
    @Column(name = "user_id", length = 10, nullable = false)
    private Integer userId;
    /**
     * 关联的用户对象
     */
    private User user;
    /**
     * 优惠券ID
     */
    @Column(name = "coupon_id", length = 10, nullable = false)
    private Integer couponId;
    /**
     * 关联的优惠券对象
     */
    private Coupon coupon;
    /**
     * 优惠券状态
     */
    private Integer status;
}
